<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html>
<html>
<head>
<base href="<%=basePath%>">
<title>新增跳转链接</title>
<%@include file="../collect/meta.jsp"%>
<script type="text/javascript" src="${ctx}/js/returnTop.js"></script>
<link rel="stylesheet" href="css/radius.css" type="text/css"></link>
<link rel="stylesheet" href="css/Inputstyle.css" type="text/css"></link>
<link rel="stylesheet" href="css/weixinurl.css" type="text/css"></link>
<style>
.tbinput {
	width: 180px;
	height: 25px;
	font-size: 14px;
	background-color: #FFFFCC;
}
</style>
</head>
<body lang="zh-cn">
	<div class="wrapper">
		<c:import url="/collect/top.jsp"></c:import>
		<div class="main-container" id="main-container">
			<div class="main-container-inner">
				<c:import url="/collect/left.jsp"></c:import>
				<div class="main-content">
					<div class="breadcrumbs" id="breadcrumbs">
						<ul class="breadcrumb">
							<li><i class="icon-home home-icon"></i>微信管理</li>
							<li>自动回复管理</li>
							<li><a href="weixinurlaction!watchAllWeixinUrl">设置跳转链接</a></li>
							<li>新增跳转链接</li>
						</ul>
						<!-- .breadcrumb -->
					</div>
					<div class="page-content">
						<div class="row">
							<div class="col-xs-12">
								<!-- PAGE CONTENT BEGINS -->
								<form action="weixinurlaction!addWeixinUrl" name="addWeixinUrl"
									method="post">
									<input type="hidden" name="weixinurl.eaId"
										value="${weixinurl.eaId }">
									<div align="center">
										<div class="common">
											<label for="one">名称:&nbsp;</label> <input type="text"
												class="input" id="one" name="weixinurl.name" />
											<div id="content1" class="cont"></div>
										</div>
										<div class="common">
											<label for="two">链接:&nbsp;</label> <input type="text"
												class="input" id="two" name="weixinurl.url" />
											<div id="content2" class="cont"></div>
										</div>
										<div class="common">
											<label for="three">备注:&nbsp;</label> <input type="text"
												class="input" id="three" name="weixinurl.description" />
											<div id="content3" class="cont"></div>
										</div>
										<div id="btn-team">
											<input type="button" class="btn btn-primary radius" id="but"
												value="添加" /> <a class="btn btn-primary radius"
												href="weixinurlaction!watchAllWeixinUrl">返回</a>
										</div>
									</div>
								</form>
								<!-- PAGE CONTENT ENDS -->
							</div>
							<!-- /.col -->
						</div>
						<!-- /.row -->
					</div>
					<!-- /.page-content -->
				</div>
				<!-- /.main-content -->
			</div>
			<!-- /.main-container-inner -->
			<a href="#" id="btn-scroll-up"
				class="btn-scroll-up btn btn-sm btn-inverse"
				style="position:fixed;bottom:0;"> <i
				class="icon-double-angle-up icon-only bigger-110"></i> </a>
		</div>
		<!-- /.main-container -->
		<div class="push"></div>
	</div>
	<c:import url="/collect/down.jsp"></c:import>

	<script type="text/javascript">
		$(document)
				.ready(
						function() {
							var nu = /\s/;
							var str = /[\ |\~|\`|\@|\#|\$|\%|\^|\&|\||\\|\[|\]|\{|\}|\"|\'|\<|\>|\/]/;

							$("input[id='one']").focus(function() {
								$(this).addClass("tbinput");
								$("div[id='content1']").html("");
							});
							$("input[id='one']").blur(
									function() {
										$(this).removeClass("tbinput");
										var one = $(this).val();

										if (one.length == 0) {
											$("div[id='content1']").html(
													"必填")
													.removeClass("success")
													.addClass("error");
											return false;
										}

										if (!nu.test(one) && !str.test(one)) {
											$("div[id='content1']").html(
													"确认").removeClass("error")
													.addClass("success");
										} else {
											$("div[id='content1']").html(
													"含有特殊字符").removeClass(
													"success")
													.addClass("error");
										}
									});

							$("input[id='two']").focus(function() {
								$(this).addClass("tbinput");
								$("div[id='content2']").html("");
							});
							$("input[id='two']").blur(
									function() {
										$(this).removeClass("tbinput");
										var two = $(this).val();

										if (two.length == 0) {
											$("div[id='content2']").html(
													"必填")
													.removeClass("success")
													.addClass("error");
											return false;
										} else {
											$("div[id='content2']").html(
													"确认").removeClass("error")
													.addClass("success");
										}
									});

							$("input[id='three']").focus(function() {
								$(this).addClass("tbinput");
								$("div[id='content3']").html("");
							});
							$("input[id='three']").blur(
									function() {
										$(this).removeClass("tbinput");
										var three = $(this).val();

										if (!str.test(three)) {
											$("div[id='content3']").html(
													"确认").removeClass("error")
													.addClass("success");
										} else {
											$("div[id='content3']").html(
													"含有特殊字符").removeClass(
													"success")
													.addClass("error");
										}
									});

							$("#but").click(
									function() {
										var one = $("div[id='content1']")
												.text();
										var two = $("div[id='content2']")
												.text();

										var des = $("input[id='three']").val();
										if (!str.test(des)) {
											$("div[id='content3']").html(
													"确认").removeClass("error")
													.addClass("success");
										} else {
											$("div[id='content3']").html(
													"含有特殊字符").removeClass(
													"success")
													.addClass("error");
										}

										var three = $("div[id='content3']")
												.text();

										if (one == "确认" && two == "确认"
												&& three == "确认") {
											$("form[name='addWeixinUrl']")
													.submit();
										} else {
											alert("请完善以上信息");
											return false;
										}
									});
						});
		//防dropmenu刷新收回;设置关键字：$新增关键字
		$(document).ready(function() {
			$('.weixinguanli > ul').show();
			$('.autoanswer > ul').show();
			$('.autoanswer > ul > li a').eq(4).css("color", "red");
		});
	</script>
</body>
</html>